package com.mairuide.bill.information.tag;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.mairuide._frame.base.BaseRepository;
import com.mairuide._frame.base.BaseServiceProxy;


/**
 * PersonTagService
 * @author mh
 *
 */

@Service
@Transactional
public class PersonTagService extends BaseServiceProxy<PersonTag> {
	
	@Resource
	private PersonTagRepository personTagRepository;
	
	@Override
	protected BaseRepository<PersonTag> getBaseRepository() {
		return personTagRepository;
	}
	
	/**
	 * 根据人员id查询所属标签集合
	 * @param personId
	 * @return
	 */
	public List<PersonTag> findByPersonId(Integer personId){
		return personTagRepository.findByPersonId(personId);
	}
	
	/**
	 * 根据人员id删除所有标签
	 * @param personId
	 */
	public void deleteByPersonId(Integer personId) {
		personTagRepository.deleteByPersonId(personId);
	}
	
}
